package com.jiang.myfm.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.jiang.myfm.R;
import com.squareup.picasso.Picasso;

public class MainHeadTwoFragment extends Fragment {

    private ImageView mImageView1, mImageView2, mImageView3, mImageView4;
    private TextView mTextView1, mTextView2, mTextView3, mTextView4;

    public MainHeadTwoFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View ret = inflater.inflate(R.layout.fragment_main_head_two, container, false);
        mImageView1 = (ImageView) ret.findViewById(R.id.main_head2_iv1);
        mImageView2 = (ImageView) ret.findViewById(R.id.main_head2_iv2);
        mImageView3 = (ImageView) ret.findViewById(R.id.main_head2_iv3);
        mImageView4 = (ImageView) ret.findViewById(R.id.main_head2_iv4);
        mTextView1 = (TextView) ret.findViewById(R.id.main_head2_tv1);
        mTextView2 = (TextView) ret.findViewById(R.id.main_head2_tv2);
        mTextView3 = (TextView) ret.findViewById(R.id.main_head2_tv3);
        mTextView4 = (TextView) ret.findViewById(R.id.main_head2_tv4);
        Bundle bundle = getArguments();
        String picUrl1 = bundle.getString("coverPath0");
        String picUrl2 = bundle.getString("coverPath1");
        String picUrl3 = bundle.getString("coverPath2");
        String picUrl4 = bundle.getString("coverPath3");
        mTextView1.setText(bundle.getString("title0"));
        mTextView2.setText(bundle.getString("title1"));
        mTextView3.setText(bundle.getString("title2"));
        mTextView4.setText(bundle.getString("title3"));
        Picasso.with(getContext()).load(picUrl1).into(mImageView1);
        Picasso.with(getContext()).load(picUrl2).into(mImageView2);
        Picasso.with(getContext()).load(picUrl3).into(mImageView3);
        Picasso.with(getContext()).load(picUrl4).into(mImageView4);
        return ret;
    }

}
